package com.share;

import com.share.config.EsConfig;
import com.share.config.MyPointConfig;
import com.share.service.NearbyService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author sunxuejian
 * @date 2020/6/29
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = App.class)
public class ElasticsearchTest1 {

    @Autowired
    MyPointConfig myPointConfig;

    @Autowired
    EsConfig esConfig;

    @Autowired
    NearbyService nearbyService;

    @Test
    public void test1() {
        System.out.println(myPointConfig);
        System.out.println(esConfig);
    }

    @Test
    @Before
    public void initData() {
        int total = 10000;
        int inserted = 0;
        nearbyService.recreateIndex();

    }
}
